class Solution(object):
    def makeFancyString(self, s):
        st = []
        for c in s:
            if len(st) < 2:
                st.append(c)
            else:
                if not st[-1] == st[-2] == c:
                    st.append(c)
        return ''.join(st)